class NotificationListModel {
  bool? success;
  int? code;
  String? message;
  NotificationResultModel? data;

  NotificationListModel({this.success, this.code, this.message, this.data});

  NotificationListModel.fromJson(Map<String, dynamic> json) {
    success = json['success'];
    code = json['code'];
    message = json['message'];
    data = json['data'] != null ? NotificationResultModel.fromJson(json['data']) : null;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['success'] = success;
    data['code'] = code;
    data['message'] = message;
    if (this.data != null) {
      data['data'] = this.data!.toJson();
    }
    return data;
  }
}

class NotificationResultModel {
  List<NotificationItemModel>? list;
  int? total;
  int? page;
  int? size;
  int? totalPage;

  NotificationResultModel({this.list, this.total, this.page, this.size, this.totalPage});

  NotificationResultModel.fromJson(Map<String, dynamic> json) {
    if (json['list'] != null) {
      list = <NotificationItemModel>[];
      json['list'].forEach((v) {
        list!.add(NotificationItemModel.fromJson(v));
      });
    }
    total = json['total'];
    page = json['page'];
    size = json['size'];
    totalPage = json['totalPage'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    if (list != null) {
      data['list'] = list!.map((v) => v.toJson()).toList();
    }
    data['total'] = total;
    data['page'] = page;
    data['size'] = size;
    data['totalPage'] = totalPage;
    return data;
  }
}

class NotificationItemModel {
  int? id;
  String? title;
  String? content;
  String? createdAt;
  String? expireAt;
  String? type;
  String? status;
  bool? isRead;

  NotificationItemModel(
      {this.id,
        this.title,
        this.content,
        this.createdAt,
        this.expireAt,
        this.type,
        this.status,
        this.isRead});

  NotificationItemModel.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    title = json['title'];
    content = json['content'];
    createdAt = json['createdAt'];
    expireAt = json['expireAt'];
    type = json['type'];
    status = json['status'];
    isRead = json['isRead'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['id'] = id;
    data['title'] = title;
    data['content'] = content;
    data['createdAt'] = createdAt;
    data['expireAt'] = expireAt;
    data['type'] = type;
    data['status'] = status;
    data['isRead'] = isRead;
    return data;
  }
}
